var INC = 5;

function checkCallback(res) {
  var resNum = parseInt(res);
  if (resNum < 10 && resNum > -10) return;
  var isNegative = parseInt(res) < 0;
  var el = $("main");
  var sizeStr = el.style.fontSize;
  var size = sizeStr.replace(/pt/,'');
  var num = parseInt(size);
  if (isNegative && num-INC > 12) {
    num -= INC;
  } else if (num+INC < 300) {
    num += INC;
  }
  var newFontSize = num + "pt";
  var debugDiv = $("debug");
  if (debugDiv) debugDiv.innerHTML = "font-size: " + newFontSize;
  el.style.fontSize = newFontSize;
}

function check() {
  sendMsg('AMS', 'checkCallback');
}
